<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>闰年计算</title>
</head>
<body>
    <h1>1949到2024之间闰年的数量</h1>
    <%!
        int countLeapYear(int year1, int year2) {
            int count = 0;
            for(int i = year1; i <= year2; i++) {
                if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0) {
                    count++;
                }
            }
            return count;
        }
    %>

    <%
        int leapYearCount = countLeapYear(1949, 2024);
    %>

    <p>1949到2024之间闰年的数量为: <%= leapYearCount %> 个</p>
</body>
</html>